


public class hello {
    final String name = "zhangsan";
    public int id;

    public hello(int id) {
        this.id = id;
    }

    public void p(){
        System.out.println("hello");
    }
    public hello get(){
        return new hello(3);
    }
    public static void main(String[] args) {
        hello h = new hello(8);
        hello h2 = h.get();
        System.out.println(h2.id);
    }
}

class hello2 extends hello{
    public int id;

    public hello2(int id) {
        super(id);
    }
    @Override
    public void p(){
        System.out.println("hello2");
    }

    @Override
    public hello get() {
        return new hello2(2);
    }
}